package com.lyf.scm.plan.api.controller;

import com.lyf.scm.plan.domain.service.BigDataEsSolutionService;
import com.rome.arch.core.clientobject.Response;
import com.rome.arch.util.controller.RomeController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * es解决方案
 *
 * @author wangchlei
 * @date 2020/10/20
 */
@Slf4j
@RomeController
@RequestMapping("/api/v1/bigData/handler")
public class BigDataEsSolutionController {
    @Resource
    private BigDataEsSolutionService bigDataEsSolutionService;

    /**
     * 处理
     *
     * @param
     * @return {@link Response}
     **/
    @PostMapping
    public Response handleApiDispatcher() {
        bigDataEsSolutionService.handleApiDispatcher();
        return Response.builderSuccess(null);
    }

    /**
     * 建索引
     *
     * @param
     * @return {@link Response}
     **/
    @GetMapping("index")
    public Response createIndex() {
        bigDataEsSolutionService.createIndex();
        return Response.builderSuccess(null);
    }
}
